﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AutoMapper;

namespace contactusform.web
{
    public class MappingHelper
    {
        /// <summary>
        /// Maps one object to another object type.
        /// </summary>
        /// <typeparam name="SourceType">Original type</typeparam>
        /// <typeparam name="DestinationType">Type to be mapped to</typeparam>
        /// <param name="sType">Object instance to be mapped</param>
        /// <returns>Mapped destination type object</returns>
        public static DestinationType Map<SourceType, DestinationType>(SourceType sType) where DestinationType : new()
        {
            var mappingResult = Mapper.Map<SourceType, DestinationType>(sType);
            return mappingResult;
        }

    }

}